package com.neuedu.corejava.ch7.homework;

import java.util.Scanner;

 class Gardener {
	public Fruit Create(){
        System.out.println("请输入一种水果：");
        Scanner in = new Scanner (System.in);
        String name = in.next();

        Fruit fruit=null ;
        switch(name){
		case "苹果":
			fruit = new Apple();
			break;
		case "香蕉":
			fruit = new Banana();
			break;
		case "葡萄":
			fruit = new Grape();
			break;
		}
        in.close();
        return fruit;


    }
}
